package java_012_zuoye04;

public class java08 {
	public static void main(String[] args) {
		String str="zahdsab";
		int num = length(str);
		System.out.println(num);
	}
	public static int length(String str) {
	    int left = 0; 
	    int length = 0;
	    for(int i=0; i < str.length(); i++){
	        for(int k = left; k < i; k++){
	            if(str.charAt(k) == str.charAt(i)){
	                left = k+1;
	                length = i-left;
	                break;
	            }
	        }
	        length++;
	    }
	    return length;
	}
}
